﻿<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>用户登录</title>
    <!--默认样式-->
    <link rel="stylesheet" href="css/reset.css">
    <!--响应式框架-->
    <link rel="stylesheet" type="text/css" href="css/bootstrap.css">
    <!--css3动画库-->
    <link rel="stylesheet" href="css/animate.css">
    <!--banner大图基础样式-->
    <link rel="stylesheet" href="css/slick.css">
    <!--页面滚动基础样式-->
    <link rel="stylesheet" href="css/jquery.fullPage.css" />
    <!--导航样式-->
    <link rel="stylesheet" href="css/head.css" />
    <!--图片和滚屏样式-->
    <link rel="stylesheet" href="css/index.css">
    <link rel="stylesheet" href="css/layui.css">
    <style>
        #fp-nav {
            display: none;
        } 

        .layui-layer-title {
            display: none !important;
        }

        .layui-layer-btn {
            display: none !important;
        }

        .layui-layer-setwin {
            display: none !important;
        }

        .loginDiv {
            width: 100%;
            height: 100%;
            background-repeat: no-repeat;
            background-size: 100% 100%;
            background-image: url(image/login/loginBg.png);
        }

        .layui-layer {
            background-color: rgba(255, 255, 255, 0) !important;
        }

        .layui-layer-content {
            padding: 0px !important;
            height: 100% !important;
        }

        .adminDiv {
            background-image: url('image/login/borderAdmin.png');
            width: 80%;
            height: 12%;
            position: absolute;
            top: 35%;
            left: 40px;
            background-repeat: no-repeat;
            background-size: 100% 100%;
        }

        .PassWordDiv {
            background-image: url('image/login/borderPassword.png');
            width: 80%;
            height: 12%;
            position: absolute;
            top: 50%;
            left: 40px;
            background-repeat: no-repeat;
            background-size: 100% 100%;
        }

        .loginButton {
            background-image: url('image/login/Signin.png');
            width: 80%;
            height: 12%;
            position: absolute;
            bottom: 10%;
            left: 40px;
            background-repeat: no-repeat;
            background-size: 100% 100%;
        }

        .inputClass {
            background-color: rgb(16,32,50);
            color: #0096ff;
            height: 90%;
            width: 80%;
            margin-left: 40px;
            margin-top: 3px;
        }

        .tishiDiv {
            position: absolute;
            top: 65%;
            left: 50px;
        }

        .pClass {
            float: left;
            color: #0096ff;
        }

        .tishiInput {
            float: left;
            margin-top: 7px !important;
        }

        a {
            color: #0096ff;
            float: left;
            margin-left: 3px;
        }

        .xianDiv {
            width: 1px;
            height: 10px;
            background-color: #0096ff;
            float: left;
            margin-top: 5px;
            margin-left: 3px;
        }
    </style>
</head>
<body>
    <!-- 导航 -->
    <div style="position: absolute; top: 10px; right: 60px; z-index: 99999;" onclick="layuiDiv();">
        <img src="image/login/loginIcon.png" style="float: left" />
        <p style="font-size: 30px; float: left; margin-top: 15px;">登录</p>
    </div>
    <!--移动端的导航-->
    <!-- 内容 -->
    <div id="index_main" class="index_main">
        <!--导航-->
        <div class="section section1">
            <div class="index_banner">
                <div class="item">
                    <div class="items scaleBg" style="background-image: url(image/login/banner1.jpg);"></div>
                </div>
                <div class="item">
                    <div class="items scaleBg" style="background-image: url(image/login/banner2.png);"></div>
                </div>
                <div class="item">
                    <div class="items scaleBg" style="background-image: url(image/login/banner2.png);"></div>
                </div>
                <div class="item">
                    <div class="items scaleBg" style="background-image: url(image/login/banner3.png);"></div>
                </div>
                <div class="item">
                    <div class="items scaleBg" style="background-image: url(image/login/banner4.png);"></div>
                </div>
            </div>
            <div class="left slick_txt">
                <div class="prev slick_arrow"></div>
            </div>
            <div class="right slick_txt">
                <div class="next slick_arrow"></div>
            </div>
            <div class="number">
                <div class="inner clearfix">
                    <span class="active">01</span>
                    <span>02</span>
                    <span>03</span>
                    <span>04</span>
                    <span>05</span>
                </div>
            </div>
        </div>
    </div>
    <script src="js/URL.js"></script>
    <script src="js/jquery.min.js"></script>
    <script src="js/jquery.fullPage.min.js"></script>
    <script src="js/index_slick.js"></script>
    <script src="js/index.js"></script>
    <script src="js/layui/layui.js"></script>
    <script src="config/config.js"></script>
    <script>
        $(function () {
            $(".loginButton").keydown(function (event) {
                if (event.keyCode == 13) {
                    login();
                }
            });
            if (getCookie('nameid') && getCookie('pwdid')) {
                $('#admin-name').value = getCookie('nameid');
                $('#admin-pwd').value = getCookie('pwdid');
            }
        });
        layui.use('layer', function () { //独立版的layer无需执行这一句
            var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
        });
        function layuiDiv() {
            layer.open({
                type: 0,
                shadeClose: true,
                area: ['500px', '400px'], //宽高
                content: '<div class="loginDiv">' +
                    '<div class="adminDiv"><input placeholder="请输入用户名"id="admin-name" class="inputClass"/></div>' +
                    '<div class="PassWordDiv" ><input placeholder="请输入密码" type="password"  id="admin-pwd" class="inputClass"/></div>' +
                    '<div class="loginButton" id="login" onclick="login();"></div>' +
                    '</div>'
            });
        }
        var url = window.location.href;
        url = url.substring(0, url.lastIndexOf("/") + 1);
        function download() {
            window.open("TOOL/hangyao/mysetup.exe");
        }
        // 设置cookie
        function setCookie(name, value, day) {
            var date = new Date();
            date.setDate(date.getDate() + day);
            document.cookie = name + '=' + value + ';expires=' + date;
        };
        // 获取cookie
        function getCookie(name) {
            var reg = RegExp(name + '=([^;]+)');
            var arr = document.cookie.match(reg);
            if (arr) {
                return arr[1];
            } else {
                return '';
            }
        };
        // 删除cookie
        function delCookie(name) {
            setCookie(name, null, -1);
        };
        function login() {
            var countName = $('#admin-name').val();
            var pwd = $('#admin-pwd').val();
            $.ajax({
                type: "post",
                url: loginUrl + "/user/getUser/" + countName + "/" + pwd,
                //contentType:"application/json;charset=utf-8",
                //data: '{"name": ' + countName + ' , "pwd" : ' + admin_pwd + '}',
                //dataType : "json",
                async: false,
                success: function (data) {
                    var check;
                    var code = data.code;
                    if (code != 200) {
                        alert(data.message);
                    } else {
                        window.localStorage.setItem('username', data.user.name);
                        window.localStorage.setItem('jurisdiction', data.user.jurisdiction);
                        window.opener = null;
                        window.open(' ', '_self');
                        window.close();
                        window.open(url + "szsp.html");
                    }
                },
                error: function (e) {
                    alert("数据跑丢了");
                }
            });
        }
    </script>
</body>
</html>
